#include "processbar.h"

void print_processbar(int cur_cap, int total_cap)
{
    //先得到当前进度，取得比例后向下取整
    int rate_nums = floor(cur_cap * 100 / total_cap);
    printf("\r[");
    for(int i = 0; i < rate_nums; i++)
    {
        printf("#");
    }
    for(int i = rate_nums; i < 100; i++)
    {
        printf(" ");
    }
    printf("]\r");
    fflush(stdout);
}